param(
    $Type
)

$Dir = $env:HOME
Write-Output $Dir
function Set-Personal-SSH {
    git config --global user.name "angela"
    git config --global user.email "ruoshui_engr@163.com"
}

function Set-Company-SSH {
    git config --global user.name "openyunzhi"
    git config --global user.email "openyunzhi@163.com"
}

function Copy-SSH-Key {
    param(
        $Name
    )
    Remove-Item "$Dir\.ssh\*"
    Copy-Item -Path "$Dir\.ssh-$Name\*" -Destination "$Dir\.ssh\"
}
$Name = "company"
if ($Type -eq "company") {
    $name = "company"
    Set-Company-SSH
}
else {
    $name = "personal"
    Set-Personal-SSH
}

Write-Output "Switch to $name SSH"
Copy-SSH-Key -Name $Name






